package com.test.mooan.labama.activity_fragment_boom;

import android.os.Bundle;

import com.test.mooan.labama.activity_fragment_boom.base_boom.BaseActivity_boom;
import com.test.mooan.labama.activity_fragment_boom.base_boom.BaseApplication_boom;
import com.test.mooan.labama.activity_fragment_boom.login_boom.LoginPhoneNumActivity_boom;
import com.test.mooan.labama.utils_boom.address_boom.AddressUtil_Niri_boom;
import com.test.mooan.labama.utils_boom.address_boom.AddressUtil_Tanz_boom;
import com.test.mooan.labama.utils_boom.analytics_boom.timezone_boom.TimeZoneUtil_boom;
import com.test.mooan.labama.utils_boom.analytics_boom.util_boom.AnalyticsUtil_boom;
import com.test.mooan.labama.utils_boom.http_boom.HttpManager_boom;
import com.test.mooan.labama.R;


public class StartActivity_boom extends BaseActivity_boom {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start_boom);
        pageTag = "LAUNCH";

        findViewById(R.id.activity_main_layout_login).setOnClickListener(v -> runProcess());

        AddressUtil_Niri_boom.parseAddress(this);
        AddressUtil_Tanz_boom.parseAddress(this);

        runProcess();
    }

    private void runProcess(){
        //获取时区配置
        HttpManager_boom.getInstance().oceanpluszone(TimeZoneUtil_boom.INSTANCE.getTimeZoneID());
    }

    public void onTimezoneResponse(){

        try {
            AnalyticsUtil_boom.INSTANCE.init(BaseApplication_boom.getInstant_boom());
//            HttpManager_boom.getInstance().saveUserPointForBatch();
        } catch (Exception e){
            e.printStackTrace();
        }

        HttpManager_boom.getInstance().getAppShowInfo();
    }

    public void onAppShowInfoResponse(){
        startActivityForSingleTop_boom(LoginPhoneNumActivity_boom.class);
    }

}